﻿//Author:Michal Sporna
//License: https://operationsneakpeek.codeplex.com/license

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Characters.Helpers
{
    /// <summary>
    /// represents 1 field of view
    /// meaning 3 circles
    /// </summary>
    public class MasterFOV
    {
        #region properties
        public List<Characters.Helpers.FOVCircle> Circles;
        public int OrderNumber; //which field of view in a move pattern
        public int Time;
        public string Direction;//which way NPC is looking


        public Util.Helpers.PublicEnums.FieldOfViewDirection FOVDirection;
        #endregion

        

        #region methods

        /// <summary>
        /// determine which way the NPC is looking
        /// </summary>
        /// <returns></returns>
        public void DetermineFOVDirection()
        {
            try
            {
                FOVDirection = Util.Helpers.PublicEnums.FieldOfViewDirection.None;


                switch (Direction)
                {
                    case "Right":
                        {
                            FOVDirection= Util.Helpers.PublicEnums.FieldOfViewDirection.Right;
                            break;
                        }
                    case "Left":
                        {
                            FOVDirection=Util.Helpers.PublicEnums.FieldOfViewDirection.Left;
                            break;
                        }
                    case "CrossUpRight":
                        {
                           FOVDirection= Util.Helpers.PublicEnums.FieldOfViewDirection.CrossUpRight;
                           break;

                        }
                    case "CrossUpLeft":
                        {
                            FOVDirection= Util.Helpers.PublicEnums.FieldOfViewDirection.CrossUpLeft;
                            break;
                        }
                    case "CrossDownRight":
                        {
                            FOVDirection= Util.Helpers.PublicEnums.FieldOfViewDirection.CrossDownRight;
                            break;
                        }
                    case "CrossDownLeft":
                        {
                            FOVDirection= Util.Helpers.PublicEnums.FieldOfViewDirection.CrossDownLeft;
                            break;
                        }
                    case "Up":
                        {
                            FOVDirection= Util.Helpers.PublicEnums.FieldOfViewDirection.Up;

                            break;
                        }
                        case "Down":
                        {
                            FOVDirection= Util.Helpers.PublicEnums.FieldOfViewDirection.Down;
                            break;
                        }

                }

                

            }
            catch (Exception ex)
            {
                Util.ErrorLogging.LogError(ex);
                FOVDirection = Util.Helpers.PublicEnums.FieldOfViewDirection.None;
            }

        }



        #endregion


    }
}
